package ru.padre386.geo_utils.reports.console;

import ru.padre386.geo_utils.data_loaders.common.IFileIteratorCallback;
import ru.padre386.geo_utils.data_loaders.common.IGeoPoint;
import ru.padre386.geo_utils.data_loaders.common.IGeoTrack;

import java.util.Date;

/**
 * Created by IntelliJ IDEA.
 * User: indrdb
 * Date: 08.02.2011
 * Time: 10:39:43
 */
public class StdOutFileIteratorCallbackImpl implements IFileIteratorCallback {
    int tracksCount = 0;
    int segmentsCount = 0;
    int pointsCount = 0;

    @Override
    public void onStart() {
        System.out.println("Started at " + new Date());
    }

    @Override
    public void onTrack(IGeoTrack track) {
        tracksCount++;
        System.out.println("\tNew track " + track.getName());
    }


    @Override
    public void onPoint(IGeoPoint point) {
        pointsCount++;
        System.out.println("\t\t\tPoint: lat " + point.getLatitude()
                + ", lon " + point.getLongitude()
                + ", ele " + point.getAltitude()
                + ", time " + point.getTime());
    }

    @Override
    public void onFinish() {
        System.out.println("Finished at " + new Date());
        System.out.println("\nStatistic:");
        System.out.println("\tTracks:\t" + tracksCount);
        System.out.println("\tSegments:\t" + segmentsCount);
        System.out.println("\tPoints:\t" + pointsCount);
    }
}
